<template>
    <div>
        <Row >
            <Col>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">用户：</label>
                <Input v-model="username" style="width:200px;"></Input>
            </Row>
            <Row type="flex" style="margin-bottom:10px" justify="center">
                <label style="line-height:32xp;">密码：</label>
                <Input v-model="password" style="width:200px;"></Input>
            </Row>
            <Row>
                <Button @click="login">登录</Button>
            </Row>
            </Col>
        </Row>
    </div>

</template>


<script>
import service from '../../service/index.js'
export default {
  name: 'login',
  props: ['id', 'name'],
  mounted() {
    //console.log(this.$route.query.id,this.$route.query.name)
    console.log(this.id, this.name);
  },
  data() {
    return {
        username:'',
        password:''
    }
  },
  methods:{
      login(){
          console.log(this.username, this.password)
          service.post('/login',{
              body:JSON.stringify({
                  userName:this.username,
                  passWord:this.password
              })
          })
          .then((res) => {
              console.log(res)
              if(res.retcode === 1)
              {
                  this.$router.push({ path:'/phone'})
              }
          })
      }
  }
}
</script>

<style lang="scss" scoped>

</style>
